import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Index',
    redirect:'/index'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import( '../views/Login.vue')
  },
  {
    path: '/test',
    name: 'Test',
    component: () => import( '../views/test.vue')
  },
  {
    path:'/home',
    name:'Home',
    component: () => import( '../views/Home.vue'),
    children:[
      {
        path:'/index',
        name:'Index',
        component:_ =>import('../views/index/Index'),
        meta:{
          title:'首页',
          kepAlive:true
        }
      },
      {
        path:'/user',
        name:'User',
        component:_ =>import('../views/user/User'),
        meta:{
          title:'会员管理',
          kepAlive:true
        }
      },
      {
        path:'/good',
        name:'Good',
        component:_ =>import('../views/good/Good'),
        meta:{
          title:'商品管理',
          kepAlive:true
        }
      },
      {
        path:'/goodClass',
        name:'GoodClass',
        component:_ =>import('../views/good/GoodClass'),
        meta:{
          title:'商品分类管理',
          kepAlive:true
        }
      },
      {
        path:'/goodStatistics',
        name:'GoodStatistics',
        component:_ =>import('../views/good/GoodStatistics'),
        meta:{
          title:'商品统计管理',
          kepAlive:true
        }
      },
      {
        path:'/system',
        name:'System',
        component:_ =>import('../views/system/System'),
        meta:{
          title:'系统管理',
          kepAlive:true
        }
      },
      {
        path:'/employee',
        name:'Employee',
        component:_ =>import('../views/employee/Employee'),
        meta:{
          title:'员工管理',
          kepAlive:true
        }
      },
      {
        path:'/info',
        name:'Info',
        component:_ =>import('../views/manager/info'),
        meta:{
          title:'个人信息',
        }
      },
      {
        path:'/GoodsStock',
        name:'GoodsStock',
        component:_ =>import('../views/good/GoodsStock'),
        meta:{
          title:'商品入库管理',
        }
      },
      {
        path:'/goodsStockInfo',
        name:'GoodsStockInfo',
        component:_ =>import('../views/good/GoodsStockInfo'),
        meta:{
          title:'商品入库管理详细信息',
        }
      },
      {
        path:'/promotion',
        name:'Promotion',
        component:_ =>import('../views/promotion/Promotion'),
        meta:{
          title:'促销活动管理',
          kepAlive:true
        }
      },
      {
        path:'/storeflow',
        name:'Storeflow',
        component:_ =>import('../views/good/Storeflow'),
        meta:{
          title:'流水管理',
          kepAlive:true
        }
      },
      {
        path:'/cutpricegoods',
        name:'PromotionGood',
        component:_ =>import('../views/promotion/PromotionGood'),
        meta:{
          title:'促销活动商品管理',

          kepAlive:true
        }
      },
    ]
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
